package com.lu.pojo.oop.animal;

/**
 * @author luzhenfang
 * @date 2020 05 12
 * @description
 * 使用面向对象的思想，设计自定义类描述兔子和青蛙。
 *
 */
public class TestAnimal {
    public static void main(String[] args) {
        Animal rabbit = new Rabbit("美人","黑色","哺乳动物");
        doSomething(rabbit);
        System.out.println("-----------------------------");
        Frog frog = new Frog("大兵","绿色","非哺乳动物");
        doSomething(frog);
        frog.doSwim();
    }

    public static void doSomething(Animal an){
        String builder = "那只" + an.getColor() + "的" + "名叫" + an.getName() + "的" +
                an.yell() + "\n" + an.eat();
        System.out.println(builder);
    }
}
